package edu.java.texbooks.scjp.threads.test04.mailbox.extra;

public class Publisher implements Runnable {

	Mailbox mailbox = null;
	String[] messages = { "Hello", "everybody.", "This is", "beginning of",
			"threads and ", "monitors concept" };

	public Publisher(Mailbox mailbox) {
		this.mailbox = mailbox;
	}

	@Override
	public void run() {
		for (String message : messages) {
			System.out.println("Publisher thread.");
			mailbox.storeMessage(message);
		}
	}
}
